<?php

$this->breadcrumbs=array(
	Yii::t('base','Iptvprogram Lists')=>array('index'),
	Yii::t('base','Manage'),
);
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#iptvprogram-list-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>
<style>
#btn
{
   margin-left:30px;
}
#tree
{margin-top:-5px;
    float:left;
}
#head
{
  float:right;
}

</style>


<h1><?php echo Yii::t('base','Manage'); echo Yii::t('base','Iptvprogram Lists'); ?></h1>

<ul style="overflow:hidden;width:100%;margin:0; padding:0;list-style:none;">
<li style="float:left; "><div>
<?php echo Yii::t('base','<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>');?></div></li>
<li style="float:right;width:300px;margin-right:10px;"><div>
<?php echo CHtml::link(Yii::t('base','Advanced Search'),'#',array('class'=>'search-button')); ?>
<a class="btn btn-small create" id='btn' title="创建电视节目" href="<?php echo Yii::app()->request->baseUrl; ?>/iptvprogramList/create">创建电视节目</a>
</div>
</li>
</ul>

<div class="search-form" style="display:none">

<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>

</div><!-- search-form -->




<div id='tree'>
 <?php $this->widget('system.web.widgets.CTreeView',array(
	'id'=>'menu-treeview',
	'data'=>array(
               array(
                   'text'=>'<span>'.Yii::t('base','All TV Type').'</span>',
                   'children'=> $model->AllType(),
                    ),
                  ),

                    'control'=>'#treecontrol',
                    'animated'=>'fast',
                    'collapsed'=>false,
                    'htmlOptions'=>array(
                            'class'=>'filetree'
                            )
 ));

?>
</div>
<div id='main'>
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'iptvprogram-list-grid',
	'dataProvider'=>$model->search(),
	//'filter'=>$model,
	'itemsCssClass'=>'responsive table table-striped table-bordered',
	'pager'=>array('class'=>'CLinkPager','hiddenPageCssClass'=>'','firstPageCssClass'=>'first paginate_button','htmlOptions'=>array('class'=>'dataTables_paginate paging_full_numbers"'),'header'=>""),
	'pagerCssClass'=>'pagination',
	'cssFile'=>false,
	'template'=>'{items}{summary}{pager}',
	'columns'=>array(
		'title',
	    array('name'=>'type_id','value'=>'IptvprogramList::model()->getTypeName($data->type_id)'),
	    //array('name'=>'type_id','value'=>'$data->type->type_name'),
		array(
		'name'=>Yii::t('base','Site Status'),
		'value'=>'IptvprogramList::model()->getLatestStatus($data->latest)." ".IptvprogramList::model()->getPopularStatus($data->popular)." ".IptvprogramList::model()->getRecommendStatus($data->recommend)',
		),
		array(
			'class'=>'CButtonColumn',
			'header'=>Yii::t('base','Operate'),
			'template'=>'{delete}{update}{Video List}',
			'updateButtonImageUrl'=>array('class'=>'gicon-edit'),
			'updateButtonOptions'=>array('class'=>'btn btn-small'),
			'deleteButtonImageUrl'=>array('class'=>'gicon-edit'),
			'deleteButtonOptions'=>array('class'=>'btn btn-inverse btn-small'),
		   
		    'buttons' => array(
		    'Video List'=>array(
		        'label'=>Yii::t('base','Video List'),
		        'url' => 'Yii::app()->createUrl("/iptvLink/createiptvLink",array("program_id"=>$data->program_id))',
		        'options' => array (
						'class' => 'btn btn-small'							
						           ),
						'visible'=>'$data->is_have_list==1',		
		          ),		
		      ),		    
			 'headerHtmlOptions'=>array(
			 'style'=>'width:30%;',
			                     ),
			),
				
	),			
			
		

)); ?>
</div>

